<template>
  <div id="bk-toast" :class="{'bk-toast__unClick': forbidClick}" v-show="show">
    <div class="bk-toast__content">
      <loading v-if="type==='loading'" class="bk-toast__icon" size="36px" color="#fff" />
      <div v-else class="bk-toast__icon" :class="type" />
      <div class="bk-toast__text" v-text="text" />
    </div>
  </div>
</template>

<script>
import loading from 'components/loading/icon'

export default {
  name: 'toast2',
  data () {
    return {
      show: false,
      forbidClick: false,
      type: 'success',
      text: '提交成功'
    }
  },
  methods: {

  },
  components: { loading }
}
</script>

<style scoped lang="less">
/* icon */
@font-face {
  font-family: "bk-toast__icon";
  src: url('iconfont.woff2?t=1630388275157') format('woff2'),
  url('iconfont.woff?t=1630388275157') format('woff'),
  url('iconfont.ttf?t=1630388275157') format('truetype');
}
#bk-toast {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3000;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  .bk-toast__content {
    padding: 18px 12px;
    max-width: 50%;
    max-height: 80%;
    background: rgba(0,0,0,.7);
    color: #fff;
    border-radius: 12px;
    display: flex;
    flex-flow: column;
    align-items: center;
    justify-content: center;

    white-space: pre-wrap;
    word-break: break-all;
    overflow: hidden;
    transition: all;
    .bk-toast__icon {
      margin: 0 30px 8px;
      font-family: bk-toast__icon,serif !important;
      font-size: 36px;
    }
    .bk-toast__text {
      min-height: 14px;
      font-size: 14px;
    }

    .bk-toast__icon.success:before { content: "\e602" }
    .bk-toast__icon.fail:before { content: "\e601" }
    .bk-toast__icon.error:before { content: "\e600" }
  }
}
#bk-toast.bk-toast__unClick { pointer-events: auto }
</style>
